{include file="header.html"}
<div id="main" class="w-full">
    <div id="page-cashier" class="w">
        <div class="online clearfix border mt10 mb20">
            <!--{if $payment.payment_code eq 'epayalipay' or $payment.payment_code eq 'epayalipaywap'}-->
            {$payform}
            <!--{elseif $payment.payment_code eq 'epaywxnative'}-->
            <div class="epaywxnative">
                <img alt="{$lang.model_qrcode_scan}" src="http://paysdk.weixin.qq.com/example/qrcode.php?data={$payform}"/>
                <div class="payinfo">{$lang.wechat_scan_pay}</div>
            </div>
            <!--{elseif $payment.payment_code eq 'epaywxjs'}-->
            <div class="epaywxjs">
                <script type="text/javascript">
                    //调用微信JS api 支付
                    function jsApiCall()
                    {
                        WeixinJSBridge.invoke(
                                'getBrandWCPayRequest',
                                {$payform},
                                function(res) {
                                    WeixinJSBridge.log(res.err_msg);
                                    if (res.err_msg == 'get_brand_wcpay_request:ok') {
                                        alert(lang.WeChat_pays_off);
                                        self.location = "{$site_url}/mobile/index.php?app=member";
                                    } else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
                                        alert(lang.cancel_WeChat_payment);
                                        self.location = "{$site_url}/mobile/index.php?app=member";
                                    } else {
                                        alert(lang.WeChat_payments_fail);
                                        self.location = "{$site_url}/mobile/index.php?app=member";
                                    }

                                    //				alert(res.err_code+res.err_desc+res.err_msg);
                                }
                        );
                    }

                    function callpay()
                    {
                        if (typeof WeixinJSBridge == "undefined") {
                            if (document.addEventListener) {
                                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                            } else if (document.attachEvent) {
                                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                            }
                        } else {
                            jsApiCall();
                        }
                    }

                </script>
                
                <div align="center">
                    <div style="color:#556B2F;font-size:30px;font-weight: bolder;">{$lang.WeChat_pays_directly}</div>
                    <button style="width:210px;height:50px;border-radius:10px;background-color:#ff67a7;border:0px #FE6714 solid;cursor:pointer;color:white;font-size:16px;margin-top:20px;" type="button" onclick="callpay()" >{$lang.immediate_payment}</button>
                    <br/>
                    <a style="width:210px;height:50px;line-height:50px;border-radius:10px;background-color:#ff67a7;color:white;font-size:16px;display:block;margin-top:20px;text-decoration:none;" href="{$site_url}/mobile/index.php?app=buyer_order">{$lang.view_order}</a>
                    <a style="width:210px;height:50px;line-height:50px;border-radius:10px;background-color:#ff67a7;color:white;font-size:16px;display:block;margin-top:20px;text-decoration:none;" href="{$site_url}/mobile/index.php">{$lang.back_index}</a>
                </div>
            </div>
            <!--{/if}-->
        </div>
    </div>
</div>
{include file="footer.html"}
